//package com.sinocare.project.common.config;
//
//import com.alibaba.fastjson.serializer.SerializerFeature;
//import com.alibaba.fastjson.support.config.FastJsonConfig;
//import com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter;
//import org.mybatis.logging.Logger;
//import org.mybatis.logging.LoggerFactory;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.http.MediaType;
//import org.springframework.http.converter.HttpMessageConverter;
//import org.springframework.http.converter.StringHttpMessageConverter;
//import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
//import org.springframework.stereotype.Component;
//import org.springframework.web.servlet.config.annotation.CorsRegistry;
//import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
//import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
//
//import java.nio.charset.Charset;
//import java.util.ArrayList;
//import java.util.List;
//
//@Component
//public class InterceptorConfig implements WebMvcConfigurer {
//
//    private final Logger log = LoggerFactory.getLogger(this.getClass());
//
//    @Override
//    public void addInterceptors(InterceptorRegistry registry) {
////注册一个拦截器
//        registry.addInterceptor(new JwtTokenInterceptor())
//                .excludePathPatterns("/sncUserLogin/login");
////                .addPathPatterns("/**");
//    }
//
////    @Override
////    public void addCorsMappings(CorsRegistry registry) {
////        // 添加映射路径
////        registry.addMapping("/**")
////                // 放行哪些原始域
////                .allowedOrigins("*")
////                // 是否发送Cookie信息
////                .allowCredentials(false)
////                // 放行哪些原始域(请求方式)
////                .allowedMethods("GET", "POST", "DELETE", "PUT", "OPTIONS", "HEAD")
////                // 放行哪些原始域(头部信息)
////                .allowedHeaders("*")
////                // 暴露哪些头部信息（因为跨域访问默认不能获取全部头部信息）
////                .exposedHeaders("Server","Content-Length", "Authorization", "Access-Token", "Access-Control-Allow-Origin","Access-Control-Allow-Credentials");
////    }
//}
//
